#include "config.h"

using namespace std;
using namespace Chat;

std::string Chat::stateMsg(StateRet stateRet)
{
    switch (stateRet) {
    case StateRet::EXCEED:   // 已达服务器链接上限
        return "The server link limit has been reached!\n";
        break;
    case StateRet::SUCCESS:   // 成功
        return "Operation was successful\n";
        break;
    case StateRet::FAILED:   // 失败
        return "operation failed!\n";
        break;
    case StateRet::DUPLICATEID:   // 重复的用户名
        return "Duplicate username!\n";
        break;
    case StateRet::INVALID:   // 不合法的用户名
        return "Illegal entry!\n";
        break;
    case StateRet::ID_NOT_EXIST:   // 账号不存在
        return "Account does not exist!\n";
        break;
    case StateRet::WRONGPWD:   // 密码错误
        return "Wrong password!\n";
        break;
    case StateRet::ALREADY_ONLINE:
        return "This user is already online!\n";
        break;
    case StateRet::ID_NOT_ONLINE:
        return "This user is not online!\n";
        break;
    case StateRet::ALL_NOT_ONLINE:
        return "No one is online!\n";
        break;
    case StateRet::MESSAGE_SELF:   // 消息对象不能选择自己
        return "Can't send messages to yourself\n";
        break;
    default:
        return "Unknown operation result!\n";
        break;
    }   // switch
}
